package com.minelx.autocha;

import org.openqa.selenium.By;

public interface IElementLocation {
	String toSelector();

	default String querySelector() {
		return String.format("document.querySelector(\"%s\")", toSelector());
	}

	default By getElementLocation() {
		return By.cssSelector(toSelector());
	}

	static IElementLocation id(String id) {
		return () -> "#" + id;
	}

	static IElementLocation selector(String selector) {
		return () -> selector;
	}
}
